package com.edu.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/*
 * @Author:princess
 * @Date 2023/11/14 11 14 19:12
 *
 */
@Controller
@RequestMapping("/mapping")
public class MappingController {
    /*
        value="请求路径"
        method="允许请求的方式"
        params="请求参数要求"
        headers="请求中请求头数据的要求"
     */
    @RequestMapping(value = "/mapping01",method = {RequestMethod.POST,RequestMethod.GET},params = {"!username","password=123456"},headers = {"User-Agent"})
    public String test01(){
        System.out.println("hello world");
        return "/index.jsp";
    }

    @PostMapping("/mapping02")
    public String test02(){
        System.out.println("只接受post请求");
        return "/index.jsp";
    }
}
